<?php
namespace Home\Controller;
use Think\Controller\RestController;
class IndexController extends RestController {
    public function index(){
        switch ($this->_method){
	  		case 'get': // get请求处理代码
	           $this->response(array('1' => 2, '2' => 3), 'json');
	           break;
	     }
    }

    public function test() {
    	$location = M("Location");
    	
    	$location->latitude = I('latitude', 0);
    	$location->lontitude = I('lontitude', 0);
    	$location->createTime = time();
    	$location->add();

    	$this->response(array('status' => 200, 'message' => 'success'), 'json');
    }

    public function _empty(){
        echo '404';
    }
}